#ifndef __MAILHEAD_H__
#define __MAILHEAD_H__

#include <stdio.h>
#include <glib.h>
#include <string.h>
#include "buffer.h"
#include "util.h"
#include "xdebug.h"
#include "common.h"

typedef struct __MailHead
{
    char   *From;
    char   *Sender;
    char   *ReplyTo;

    char   *To;
    char   *Cc;
    char   *Bcc;

    char   *MessageId;
    
    char   *Date;
    GSList *Received;    

    char   *Subject;    
   
    GHashTable  *Others;

    int     endpos;
}MAILHEAD;

MAILHEAD*   mailhead_new();
void        mailhead_delete(MAILHEAD*);
void        mailhead_clear(MAILHEAD*);
int         mailhead_set(void *, char*, char*, int);
int         mailhead_parse(MAILHEAD*, BUFFER *);
void        mailhead_print(MAILHEAD*);
int         mailhead_string(MAILHEAD*, char *, int);

#endif


